<!-- In this template we are using a function defined in nbbajax.js and jquery.genxmlajax.js so include the script here -->
<script type="text/javascript" src="/DesktopModules/NBright/NBrightBuy/Themes/config/js/nbbajax.js"></script>
<script src="/DesktopModules/NBright/NBrightBuy/Themes/config/js/jquery.genxmlajax.js" type="text/javascript"></script>
<script type="text/javascript" src="/DesktopModules/NBright/NBrightBuy/Themes/config/js/categoryajax.js"></script>

<script type="text/javascript">
    $(document).ready(function () {
        $('.box-content').toggle(); // Initially hide all panels - Doesn't hide Products in cat - need to fox
        $('.categorydetails div.box-content').toggle(); // Then open specific ones
        $('.pageactions div.box-content').toggle();
        $('.categoryselectproducts div.box-content').toggle();
        $('.categoryproducts div.box-content').toggle();
    });

</script>

<div id="confirmmsg" style="display:none;">
[<tag type="valueof" resourcekey="General.Confirm" />]    
</div>

<div id="nbsnotify"></div>
<div id="loader" class="processing" style="display:none;">[<tag type="label" resourcekey="General.ProcessingDiv" />]</div>


<br />

<div id="pageactionssource"><!-- Page actions are moved into header bar - also exist at page bottom-->
	<div class="col-xs-9 col-sm-9">
		<a href="#" class="show-sidebar">
		  <i class="fa fa-bars"></i>
		</a>
		<div class="actionbuttonwrapper">
    	[<tag id="cmdSave" type="linkbutton" cssclass="btn btn-primary" resourcekey="General.cmdSaveButton" commandname="save" commandargument="ItemID" />] 
		[<tag id="cmdReturn" type="linkbutton" cssclass="btn btn-default" resourcekey="General.cmdReturnButton" commandname="return" />] 
	    </div>
	</div>
	<div class="col-xs-3 col-sm-3 top-panel-right">
		[<tag type="selectlocalebutton" size="32"/>]
	</div>
</div>


<div id="categorydatasection">

    <div id="categorydata">
        
        <div id="productselectparams">
            [<tag id="itemid" type="hidden" databind="ItemId" />]
            [<tag id="lang" type="hidden" databind="Lang" />]
            [<tag id="header" type="hidden" value="propertyproductheader.html"/>]
            [<tag id="body" type="hidden" value="propertyproductbody.html"/>]
            [<tag id="footer" type="hidden" value="propertyproductfooter.html"/>]
            [<tag id="orderby" type="hidden" value="{bycategoryproduct}"/>]
            [<tag id="pagesize" type="hidden" value="30"/>]
            [<tag id="pagenumber" type="hidden" value="1"/>]
            [<tag id="selectedcatid" type="hidden" value=""/>]            
            [<tag id="searchtext" type="hidden" value=""/>]     
            [<tag id="searchcategory" type="hidden" value=""/>]     
        </div>

        [<tag id="fields" type="postback" value="genxml/textbox/propertyref,genxml/checkbox/chkishidden,genxml/textbox/image,genxml/textbox/txtcategoryref,genxml/dropdownlist/ddlgrouptype,genxml/textbox/producttemplate,genxml/textbox/listitemtemplate,genxml/dropdownlist/ddlparentcatid" />]
        [<tag id="localizedfields" type="postback" value="genxml/textbox/txtcategoryname,genxml/textbox/txtcategorydesc,genxml/textbox/txtseoname,genxml/textbox/txtmetadescription,genxml/textbox/txtmetakeywords,genxml/textbox/txtseopagetitle,genxml/edt/message" />]

        <div class="hidden">[<tag id="ddlgrouptype" type="groupdropdown" groupsonly="true" />]</div><!-- Required - Sets grouptype to only properties and hides the field -->

        <div class="row categorydetails">
            <div class="col-md-12">
                <div class="box">
                    <div class="box-header">
                        <div class="box-name">
                            <i class="fa fa-search"></i><span>[<tag type="valueof" resourcekey="General.Property" />] ID: [<tag type="valueof" databind="ItemId" />]</span>
                        </div>
                        <div class="box-icons">
                            <a class="collapse-link"><i class="fa fa-chevron-up"></i>
                            </a><a class="expand-link"><i class="fa fa-expand"></i></a>
                            <a class="close-link"><i class="fa fa-times"></i></a></div>
                        <div class="no-move">
                        </div>
                    </div>
                    <div class="box-content">
                        <div class="form-horizontal dnnForm">
                            <div class="col-sm-12">
                                <div class="form-group">
                                    <div class="col-sm-2">
                                        <label class="control-label">[<tag type="valueof" resourcekey="General.Ref" />]</label>
                                        [<tag id="propertyref" cssclass="form-control" type="textbox" maxlength="50" />]
                                    </div>
                                    <div class="col-sm-4">
                                        <label class="control-label">[<tag type="valueof" resourcekey="General.Name" />]</label>
                                        [<tag id="txtcategoryname" cssclass="form-control" type="textbox" maxlength="250" />]
                                    </div>
                                    <div class="col-sm-2">
                                        <label class="control-label">[<tag type="valueof" resourcekey="General.Type" />]</label>
                                        [<tag id="ddlparentcatid" cssclass="s2_with_tag populate placeholder" type="groupdropdown" allowblank="true" showhidden="true" groupsonly="true" />]
                                    </div>
                                    <div class="col-sm-4"><br>
                                        [<tag id="chkishidden" type="checkbox" Text="" />]
                                        <label class="control-label">[<tag type="valueof" resourcekey="General.Hidden" />]</label>
                                        [<tag id="chkdisable" type="checkbox" Text="" />]
                                        <label class="control-label">[<tag type="valueof" resourcekey="General.Disable" />]</label>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
        </div>

        <!--  PRODUCT LIST AJAX  (Ajax populates this div with the html)-->
        [<tag id="resourcepath" type="meta" value="/DesktopModules/NBright/NBrightBuy/App_LocalResources/" />]

<div class="row categoryproducts">
	<div class="col-md-12">
		<div class="box">
			<div class="box-header">
				<div class="box-name">
					<i class="fa fa-search"></i><span>Products with this Property</span>
				</div>
				<div class="box-icons">
					<a class="collapse-link"><i class="fa fa-chevron-up"></i>
					</a><a class="expand-link"><i class="fa fa-expand"></i></a>
					<a class="close-link"><i class="fa fa-times"></i></a></div>
				<div class="no-move">
				</div>
			</div>
			<div class="box-content">
				<div class="form-horizontal dnnForm">
					<div class="form-group">
						<div class="col-sm-4">
							<a id="productselect" class="btn btn-primary">[<tag type="htmlof" resourcekey="General.cmdAddButton" />]</a>
							<a id="removeall" class="btn btn-danger">[<tag type="htmlof" resourcekey="General.RemoveAllButton" />]</a>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-12">
						    <div id="productlist"></div><!-- Injects propertyproductheader/body/footer -->
						</div>
					</div>
				</div>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>
</div>

        <div class="row categorymessage hidden"><!-- Hidden for now -->
            <div class="col-md-12">
                <div class="box">
                    <div class="box-header">
                        <div class="box-name">
                            <i class="fa fa-search"></i><span>[<tag type="valueof" resourcekey="General.Message" />] [<tag type="valueof" resourcekey="General.Editor" />]</span>
                        </div>
                        <div class="box-icons">
                            <a class="collapse-link"><i class="fa fa-chevron-down"></i>
                            </a><a class="expand-link"><i class="fa fa-expand"></i></a>
                            <a class="close-link"><i class="fa fa-times"></i></a></div>
                        <div class="no-move">
                        </div>
                    </div>
                    <div class="box-content">
                        <div class="form-horizontal dnnForm">
                            <div class="col-md-12">
                                <div class="form-group">
                                    <div class="col-md-12">
                                        <label class="control-label sr-only">[<tag type="valueof" resourcekey="General.Message" />]</label>
                                        [<tag id="message" cssclass="form-control" type="dnn:dnntexteditor" height="400" width="100%" />]
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
        </div>

        <div class="row categorytemplates hidden"><!-- Hidden for now -->
            <div class="col-md-12">
                <div class="box">
                    <div class="box-header">
                        <div class="box-name">
                            <i class="fa fa-search"></i><span>[<tag type="valueof" resourcekey="General.Templates" />]</span>
                        </div>
                        <div class="box-icons">
                            <a class="collapse-link"><i class="fa fa-chevron-down"></i>
                            </a><a class="expand-link"><i class="fa fa-expand"></i></a>
                            <a class="close-link"><i class="fa fa-times"></i></a></div>
                        <div class="no-move">
                        </div>
                    </div>
                    <div class="box-content">
                        <p><i class="fa fa-info"></i>Some information about these options on this page here.</p>
                        <div class="form-horizontal dnnForm">
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <div class="col-sm-12">
                                        <label class="control-label">[<tag type="valueof" resourcekey="General.List" />]</label>
                                        [<tag id="listitemtemplate" cssclass="form-control" type="textbox" maxlength="250" />]
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <div class="col-sm-12">
                                        <label class="control-label">[<tag type="valueof" resourcekey="General.Detail" />]</label>
                                        [<tag id="producttemplate" cssclass="form-control" type="textbox" maxlength="250" />]
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
        </div>


		<!--  PRODUCT LIST FOOTER-->

        [<tag type="if" function="settings" key="pageactions" testvalue="True" display="{ON}" />]
        <div class="row pageactions"><!-- Page actions - also at top -->
            <div class="col-md-12">
                <div class="box">
                    <div class="box-content">
                        <div class="col-sm-6">
                            [<tag id="cmdSave2" type="linkbutton" cssclass="btn btn-primary" resourcekey="General.cmdSaveButton" commandname="save" commandargument="ItemID" />] 
                            [<tag id="cmdReturn2" type="linkbutton" cssclass="btn btn-default" resourcekey="General.cmdReturnButton" commandname="return" />] 
                        </div>
                        <div class="col-sm-6 text-right">
                            [<tag type="selectlocalebutton" size="32"/>]
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
        </div>
        [<tag type="endif" />]

    </div>

</div>

<div id="productselectsection" style="display:none;"><!-- Add products to category -->

    <div class="row categoryselectproducts">
        <div class="col-md-12">
            <div class="box">
                <div class="box-header">
                    <div class="box-name">
                        <i class="fa fa-search"></i><span>[<tag type="valueof" resourcekey="General.Add" />] [<tag type="valueof" resourcekey="General.Products" />]</span>
                    </div>
                    <div class="box-icons">
                        <a class="collapse-link"><i class="fa fa-chevron-down"></i>
                        </a><a class="expand-link"><i class="fa fa-expand"></i></a>
                        <a class="close-link"><i class="fa fa-times"></i></a></div>
                    <div class="no-move">
                    </div>
                </div>
                <div class="box-content">
                    <div class="form-horizontal dnnForm">
                        <div class="form-group">

                            <div class="col-sm-2">
                                <a href="#" class="btn btn-primary" id="returnfromselect">[<tag type="valueof" resourcekey="General.cmdReturn" />]</a>
                            </div>
                            <div class="col-sm-3">
                                [<tag id="txtSearch" cssclass="form-control" type="textbox" />]
                            </div>
                            <div class="col-sm-3">
                                [<tag id="ddlsearchcategory" cssclass="s2_with_tag populate placeholder" type="catdropdown" allowblank="true" showhidden="True" groupsonly="true" />]
                            </div>
                            <div class="col-sm-2">
                                <a href="#" class="btn btn-default" id="selectsearch">[<tag type="valueof" resourcekey="General.cmdSearch" />]</a>
                            </div>
                            <div class="col-sm-2">
                                <a href="#" class="btn btn-default" id="selectreset">[<tag type="valueof" resourcekey="General.cmdReset" />]</a>
                            </div>
                        </div>
					
                        <div class="form-group">
                            <div class="col-sm-12">
                                <div id="productselectlist" class="productlist"></div><!-- Injects productselectheader/body/footer -->
                            </div>
                        </div>

                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>

</div>

<div >
Ref:   [<tag type="valueof" databind="GUIDKey" />]
</div>